home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / cvs-1.8 / cvs-1 / cvs-1.8.1 / doc / cvsclient.info < prev    next >
Encoding:
GNU Info File  |  1996-05-06  |  36.6 KB  |  848 lines

  1. This is Info file cvsclient.info, produced by Makeinfo-1.63 from the
  2. input file ./cvsclient.texi.
  3.  
  4. 
  5. File: cvsclient.info,  Node: Top,  Next: Introduction,  Up: (dir)
  6.  
  7. CVS Client/Server
  8. *****************
  9.  
  10.    This document describes the client/server protocol used by CVS.  It
  11. does not describe how to use or administer client/server CVS; see the
  12. regular CVS manual for that.  This is version 1.8.1 of the protocol
  13. specification--*Note Introduction:: for more on what this version number
  14. means.
  15.  
  16. * Menu:
  17.  
  18. * Introduction::      What is CVS and what is the client/server protocol for?
  19. * Goals::             Basic design decisions, requirements, scope, etc.
  20. * Notes::             Notes on the current implementation
  21. * Protocol Notes::    Possible enhancements, limitations, etc. of the protocol
  22. * Connection and Authentication::  Various ways to connect to the server
  23. * Protocol::          Complete description of the protocol
  24.  
  25. 
  26. File: cvsclient.info,  Node: Introduction,  Next: Goals,  Prev: Top,  Up: Top
  27.  
  28. Introduction
  29. ************
  30.  
  31.    CVS is a version control system (with some additional configuration
  32. management functionality).  It maintains a central "repository" which
  33. stores files (often source code), including past versions, information
  34. about who modified them and when, and so on.  People who wish to look
  35. at or modify those files, known as "developers", use CVS to "check out"
  36. a "working directory" from the repository, to "check in" new versions
  37. of files to the repository, and other operations such as viewing the
  38. modification history of a file.  If developers are connected to the
  39. repository by a network, particularly a slow or flaky one, the most
  40. efficient way to use the network is with the CVS-specific protocol
  41. described in this document.
  42.  
  43.    Developers, using the machine on which they store their working
  44. directory, run the CVS "client" program.  To perform operations which
  45. cannot be done locally, it connects to the CVS "server" program, which
  46. maintains the repository.  For more information on how to connect see
  47. *Note Connection and Authentication::.
  48.  
  49.    This document describes the CVS protocol.  Unfortunately, it does not
  50. yet completely document one aspect of the protocol--the detailed
  51. operation of each CVS command and option--and one must look at the CVS
  52. user documentation, `cvs.texinfo', for that information.  The protocol
  53. is non-proprietary (anyone who wants to is encouraged to implement it)
  54. and an implementation, known as CVS, is available under the GNU Public
  55. License.  The CVS distribution, containing this implementation,
  56. `cvs.texinfo', and a copy (possibly more or less up to date than what
  57. you are reading now) of this document, `cvsclient.texi', can be found
  58. at the usual GNU FTP sites, with a filename such as
  59. `cvs-VERSION.tar.gz'.
  60.  
  61.    This is version 1.8.1 of the protocol specification.  This version
  62. number is intended only to aid in distinguishing different versions of
  63. this specification.  Although the specification is currently maintained
  64. in conjunction with the CVS implementation, and carries the same
  65. version number, it also intends to document what is involved with
  66. interoperating with other implementations (such as other versions of
  67. CVS); see *Note Requirements::.  This version number should not be used
  68. by clients or servers to determine what variant of the protocol to
  69. speak; they should instead use the `valid-requests' and
  70. `Valid-responses' mechanism (*note Protocol::.), which is more flexible.
  71.  
  72. 
  73. File: cvsclient.info,  Node: Goals,  Next: Notes,  Prev: Introduction,  Up: Top
  74.  
  75. Goals
  76. *****
  77.  
  78.    * Do not assume any access to the repository other than via this
  79.      protocol.  It does not depend on NFS, rdist, etc.
  80.  
  81.    * Providing a reliable transport is outside this protocol.  It is
  82.      expected that it runs over TCP, UUCP, etc.
  83.  
  84.    * Security and authentication are handled outside this protocol (but
  85.      see below about `cvs kserver').
  86.  
  87.    * This might be a first step towards adding transactions to CVS
  88.      (i.e. a set of operations is either executed atomically or none of
  89.      them is executed), improving the locking, or other features.  The
  90.      current server implementation is a long way from being able to do
  91.      any of these things.  The protocol, however, is not known to
  92.      contain any defects which would preclude them.
  93.  
  94.    * The server never has to have any CVS locks in place while it is
  95.      waiting for communication with the client.  This makes things
  96.      robust in the face of flaky networks.
  97.  
  98.    * Data is transferred in large chunks, which is necessary for good
  99.      performance.  In fact, currently the client uploads all the data
  100.      (without waiting for server responses), and then waits for one
  101.      server response (which consists of a massive download of all the
  102.      data).  There may be cases in which it is better to have a richer
  103.      interraction, but the need for the server to release all locks
  104.      whenever it waits for the client makes it complicated.
  105.  
  106. 
  107. File: cvsclient.info,  Node: Notes,  Next: Protocol Notes,  Prev: Goals,  Up: Top
  108.  
  109. Notes on the Current Implementation
  110. ***********************************
  111.  
  112.    The client is built in to the normal `cvs' program, triggered by a
  113. `CVSROOT' variable containing a colon, for example
  114. `cygnus.com:/rel/cvsfiles'.
  115.  
  116.    The client stores what is stored in checked-out directories
  117. (including `CVS').  The way these are stored is totally compatible with
  118. standard CVS.  The server requires no storage other than the repository,
  119. which also is totally compatible with standard CVS.
  120.  
  121.    The server is started by `cvs server'.  There is no particularly
  122. compelling reason for this rather than making it a separate program
  123. which shares a lot of sources with cvs.
  124.  
  125.    The server can also be started by `cvs kserver', in which case it
  126. does an initial Kerberos authentication on stdin.  If the authentication
  127. succeeds, it subsequently runs identically to `cvs server'.
  128.  
  129.    The current server implementation can use up huge amounts of memory
  130. when transmitting a lot of data over a slow link (i.e. the network is
  131. slower than the server can generate the data).  There is some
  132. experimental code (see `SERVER_FLOWCONTROL' in options.h) which should
  133. help significantly.
  134.  
  135. 
  136. File: cvsclient.info,  Node: Protocol Notes,  Next: Connection and Authentication,  Prev: Notes,  Up: Top
  137.  
  138. Notes on the Protocol
  139. *********************
  140.  
  141.    A number of enhancements are possible:
  142.  
  143.    * The `Modified' request could be speeded up by sending diffs rather
  144.      than entire files.  The client would need some way to keep the
  145.      version of the file which was originally checked out, which would
  146.      double client disk space requirements or require coordination with
  147.      editors (e.g. maybe it could use emacs numbered backups).  This
  148.      would also allow local operation of `cvs diff' without arguments.
  149.  
  150.    * Have the client keep a copy of some part of the repository.  This
  151.      allows all of `cvs diff' and large parts of `cvs update' and `cvs
  152.      ci' to be local.  The local copy could be made consistent with the
  153.      master copy at night (but if the master copy has been updated since
  154.      the latest nightly re-sync, then it would read what it needs to
  155.      from the master).
  156.  
  157.    * Provide encryption using kerberos.
  158.  
  159.    * The current procedure for `cvs update' is highly sub-optimal if
  160.      there are many modified files.  One possible alternative would be
  161.      to have the client send a first request without the contents of
  162.      every modified file, then have the server tell it what files it
  163.      needs.  Note the server needs to do the what-needs-to-be-updated
  164.      check twice (or more, if changes in the repository mean it has to
  165.      ask the client for more files), because it can't keep locks open
  166.      while waiting for the network.  Perhaps this whole thing is
  167.      irrelevant if client-side repositories are implemented, and the
  168.      rcsmerge is done by the client.
  169.  
  170. 
  171. File: cvsclient.info,  Node: Connection and Authentication,  Next: Protocol,  Prev: Protocol Notes,  Up: Top
  172.  
  173. How to Connect to and Authenticate Oneself to the CVS server
  174. ************************************************************
  175.  
  176.    Connection and authentication occurs before the CVS protocol itself
  177. is started.  There are several ways to connect.
  178.  
  179. rsh
  180.      If the client has a way to execute commands on the server, and
  181.      provide input to the commands and output from them, then it can
  182.      connect that way.  This could be the usual rsh (port 514)
  183.      protocol, Kerberos rsh, SSH, or any similar mechanism.  The client
  184.      may allow the user to specify the name of the server program; the
  185.      default is `cvs'.  It is invoked with one argument, `server'.
  186.      Once it invokes the server, the client proceeds to start the cvs
  187.      protocol.
  188.  
  189. kserver
  190.      The kerberized server listens on a port (in the current
  191.      implementation, by having inetd call "cvs kserver") which defaults
  192.      to 1999.  The client connects, sends the usual kerberos
  193.      authentication information, and then starts the cvs protocol.
  194.      Note: port 1999 is officially registered for another use, and in
  195.      any event one cannot register more than one port for CVS, so the
  196.      kerberized client and server should be changed to use port 2401
  197.      (see below), and send a different string in place of `BEGIN AUTH
  198.      REQUEST' to identify the authentication method in use.  However,
  199.      noone has yet gotten around to implementing this.
  200.  
  201. pserver
  202.      The password authenticated server listens on a port (in the current
  203.      implementation, by having inetd call "cvs pserver") which defaults
  204.      to 2401 (this port is officially registered).  The client
  205.      connects, sends the string `BEGIN AUTH REQUEST', a linefeed, the
  206.      cvs root, a linefeed, the username, a linefeed, the password
  207.      trivially encoded (see scramble.c in the cvs sources), a linefeed,
  208.      the string `END AUTH REQUEST', and a linefeed.  The server
  209.      responds with `I LOVE YOU' and a linefeed if the authentication is
  210.      successful or `I HATE YOU' and a linefeed if the authentication
  211.      fails.  After receiving `I LOVE YOU', the client proceeds with the
  212.      cvs protocol.  If the client wishes to merely authenticate without
  213.      starting the cvs protocol, the procedure is the same, except
  214.      `BEGIN AUTH REQUEST' is replaced with `BEGIN VERIFICATION
  215.      REQUEST', `END AUTH REQUEST' is replaced with `END VERIFICATION
  216.      REQUEST', and upon receipt of `I LOVE YOU' the connection is
  217.      closed rather than continuing.
  218.  
  219. 
  220. File: cvsclient.info,  Node: Protocol,  Prev: Connection and Authentication,  Up: Top
  221.  
  222. The CVS client/server protocol
  223. ******************************
  224.  
  225.    In the following, `\n' refers to a linefeed and `\t' refers to a
  226. horizontal tab.
  227.  
  228. * Menu:
  229.  
  230. * Entries Lines::
  231. * Modes::
  232. * Filenames::                       Conventions regarding filenames
  233. * Requests::
  234. * Responses::
  235. * Example::
  236. * Requirements::
  237.  
  238. 
  239. File: cvsclient.info,  Node: Entries Lines,  Next: Modes,  Up: Protocol
  240.  
  241. Entries Lines
  242. =============
  243.  
  244.    Entries lines are transmitted as:
  245.  
  246.      / NAME / VERSION / CONFLICT / OPTIONS / TAG_OR_DATE
  247.  
  248.    TAG_OR_DATE is either `T' TAG or `D' DATE or empty.  If it is
  249. followed by a slash, anything after the slash shall be silently ignored.
  250.  
  251.    VERSION can be empty, or start with `0' or `-', for no user file,
  252. new user file, or user file to be removed, respectively.
  253.  
  254.    CONFLICT, if it starts with `+', indicates that the file had
  255. conflicts in it.  The rest of CONFLICT is `=' if the timestamp matches
  256. the file, or anything else if it doesn't.  If CONFLICT does not start
  257. with a `+', it is silently ignored.
  258.  
  259. 
  260. File: cvsclient.info,  Node: Modes,  Next: Filenames,  Prev: Entries Lines,  Up: Protocol
  261.  
  262. Modes
  263. =====
  264.  
  265.    A mode is any number of repetitions of
  266.  
  267.      MODE-TYPE = DATA
  268.  
  269.    separated by `,'.
  270.  
  271.    MODE-TYPE is an identifier composed of alphanumeric characters.
  272. Currently specified: `u' for user, `g' for group, `o' for other (see
  273. below for discussion of whether these have their POSIX meaning or are
  274. more loose).  Unrecognized values of MODE-TYPE are silently ignored.
  275.  
  276.    DATA consists of any data not containing `,', `\0' or `\n'.  For
  277. `u', `g', and `o' mode types, data consists of alphanumeric characters,
  278. where `r' means read, `w' means write, `x' means execute, and
  279. unrecognized letters are silently ignored.
  280.  
  281.    The two most obvious ways in which the mode matters are: (1) is it
  282. writeable?  This is used by the developer communication features, and
  283. is implemented even on OS/2 (and could be implemented on DOS), whose
  284. notion of mode is limited to a readonly bit. (2) is it executable?
  285. Unix CVS users need CVS to store this setting (for shell scripts and
  286. the like).  The current CVS implementation on unix does a little bit
  287. more than just maintain these two settings, but it doesn't really have
  288. a nice general facility to store or version control the mode, even on
  289. unix, much less across operating systems with diverse protection
  290. features.  So all the ins and outs of what the mode means across
  291. operating systems haven't really been worked out (e.g. should the VMS
  292. port use ACLs to get POSIX semantics for groups?).
  293.  
  294. 
  295. File: cvsclient.info,  Node: Filenames,  Next: Requests,  Prev: Modes,  Up: Protocol
  296.  
  297. Conventions regarding transmission of file names
  298. ================================================
  299.  
  300.    In most contexts, `/' is used to separate directory and file names
  301. in filenames, and any use of other conventions (for example, that the
  302. user might type on the command line) is converted to that form.  The
  303. only exceptions might be a few cases in which the server provides a
  304. magic cookie which the client then repeats verbatim, but as the server
  305. has not yet been ported beyond unix, the two rules provide the same
  306. answer (and what to do if future server ports are operating on a
  307. repository like e:/foo or CVS_ROOT:[FOO.BAR] has not been carefully
  308. thought out).
  309.  
  310. 
  311. File: cvsclient.info,  Node: Requests,  Next: Responses,  Prev: Filenames,  Up: Protocol
  312.  
  313. Requests
  314. ========
  315.  
  316.    File contents (noted below as FILE TRANSMISSION) can be sent in one
  317. of two forms.  The simpler form is a number of bytes, followed by a
  318. newline, followed by the specified number of bytes of file contents.
  319. These are the entire contents of the specified file.  Second, if both
  320. client and server support `gzip-file-contents', a `z' may precede the
  321. length, and the `file contents' sent are actually compressed with
  322. `gzip'.  The length specified is that of the compressed version of the
  323. file.
  324.  
  325.    In neither case are the file content followed by any additional data.
  326. The transmission of a file will end with a newline iff that file (or its
  327. compressed form) ends with a newline.
  328.  
  329. `Root PATHNAME \n'
  330.      Response expected: no.  Tell the server which `CVSROOT' to use.
  331.      PATHNAME must already exist; if creating a new root, use the
  332.      `init' request, not `Root'.  PATHNAME does not include the
  333.      hostname of the server, how to access the server, etc.; by the time
  334.      the CVS protocol is in use, connection, authentication, etc., are
  335.      already taken care of.
  336.  
  337. `Valid-responses REQUEST-LIST \n'
  338.      Response expected: no.  Tell the server what responses the client
  339.      will accept.  request-list is a space separated list of tokens.
  340.  
  341. `valid-requests \n'
  342.      Response expected: yes.  Ask the server to send back a
  343.      `Valid-requests' response.
  344.  
  345. `Repository REPOSITORY \n'
  346.      Response expected: no.  Tell the server what repository to use.
  347.      This should be a directory name from a previous server response.
  348.      Note that this both gives a default for `Entry ' and `Modified '
  349.      and also for `ci' and the other commands; normal usage is to send a
  350.      `Repository ' for each directory in which there will be an `Entry
  351.      ' or `Modified ', and then a final `Repository ' for the original
  352.      directory, then the command.
  353.  
  354. `Directory LOCAL-DIRECTORY \n'
  355.      Additional data: REPOSITORY \n.  This is like `Repository', but
  356.      the local name of the directory may differ from the repository
  357.      name.  If the client uses this request, it affects the way the
  358.      server returns pathnames; see *Note Responses::.  LOCAL-DIRECTORY
  359.      is relative to the top level at which the command is occurring
  360.      (i.e. the last `Directory' or `Repository' which is sent before
  361.      the command).
  362.  
  363. `Max-dotdot LEVEL \n'
  364.      Tell the server that LEVEL levels of directories above the
  365.      directory which `Directory' requests are relative to will be
  366.      needed.  For example, if the client is planning to use a
  367.      `Directory' request for `../../foo', it must send a `Max-dotdot'
  368.      request with a LEVEL of at least 2.  `Max-dotdot' must be sent
  369.      before the first `Directory' request.
  370.  
  371. `Static-directory \n'
  372.      Response expected: no.  Tell the server that the directory most
  373.      recently specified with `Repository' or `Directory' should not have
  374.      additional files checked out unless explicitly requested.  The
  375.      client sends this if the `Entries.Static' flag is set, which is
  376.      controlled by the `Set-static-directory' and
  377.      `Clear-static-directory' responses.
  378.  
  379. `Sticky TAGSPEC \n'
  380.      Response expected: no.  Tell the server that the directory most
  381.      recently specified with `Repository' has a sticky tag or date
  382.      TAGSPEC.  The first character of TAGSPEC is `T' for a tag, or `D'
  383.      for a date.  The remainder of TAGSPEC contains the actual tag or
  384.      date.
  385.  
  386. `Checkin-prog PROGRAM \n'
  387.      Response expected: no.  Tell the server that the directory most
  388.      recently specified with `Directory' has a checkin program PROGRAM.
  389.      Such a program would have been previously set with the
  390.      `Set-checkin-prog' response.
  391.  
  392. `Update-prog PROGRAM \n'
  393.      Response expected: no.  Tell the server that the directory most
  394.      recently specified with `Directory' has an update program PROGRAM.
  395.      Such a program would have been previously set with the
  396.      `Set-update-prog' response.
  397.  
  398. `Entry ENTRY-LINE \n'
  399.      Response expected: no.  Tell the server what version of a file is
  400.      on the local machine.  The name in ENTRY-LINE is a name relative
  401.      to the directory most recently specified with `Repository'.  If
  402.      the user is operating on only some files in a directory, `Entry'
  403.      requests for only those files need be included.  If an `Entry'
  404.      request is sent without `Modified', `Unchanged', or `Lost' for that
  405.      file the meaning depends on whether `UseUnchanged' has been sent;
  406.      if it has been it means the file is lost, if not it means the file
  407.      is unchanged.
  408.  
  409. `Modified FILENAME \n'
  410.      Response expected: no.  Additional data: mode, \n, file
  411.      transmission.  Send the server a copy of one locally modified
  412.      file.  FILENAME is relative to the most recent repository sent
  413.      with `Repository'.  If the user is operating on only some files in
  414.      a directory, only those files need to be included.  This can also
  415.      be sent without `Entry', if there is no entry for the file.
  416.  
  417. `Lost FILENAME \n'
  418.      Response expected: no.  Tell the server that FILENAME no longer
  419.      exists.  The name is relative to the most recent repository sent
  420.      with `Repository'.  This is used for any case in which `Entry' is
  421.      being sent but the file no longer exists.  If the client has
  422.      issued the `UseUnchanged' request, then this request is not used.
  423.  
  424. `Unchanged FILENAME \n'
  425.      Response expected: no.  Tell the server that FILENAME has not been
  426.      modified in the checked out directory.  The name is relative to
  427.      the most recent repository sent with `Repository'.  This request
  428.      can only be issued if `UseUnchanged' has been sent.
  429.  
  430. `UseUnchanged \n'
  431.      Response expected: no.  Tell the server that the client will be
  432.      indicating unmodified files with `Unchanged', and that files for
  433.      which no information is sent are nonexistent on the client side,
  434.      not unchanged.  This is necessary for correct behavior since only
  435.      the server knows what possible files may exist, and thus what
  436.      files are nonexistent.
  437.  
  438. `Notify FILENAME \n'
  439.      Tell the server that a `edit' or `unedit' command has taken place.
  440.      The server needs to send a `Notified' response, but such response
  441.      is deferred until the next time that the server is sending
  442.      responses.  Response expected: no.  Additional data:
  443.           NOTIFICATION-TYPE \t TIME \t CLIENTHOST \t
  444.           WORKING-DIR \t WATCHES \n
  445.      where NOTIFICATION-TYPE is `E' for edit or `U' for unedit, TIME is
  446.      the time at which the edit or unedit took place, CLIENTHOST is the
  447.      name of the host on which the edit or unedit took place, and
  448.      WORKING-DIR is the pathname of the working directory where the
  449.      edit or unedit took place.  WATCHES are the temporary watches to
  450.      set; if it is followed by \t then the tab and the rest of the line
  451.      are ignored.
  452.  
  453. `Questionable FILENAME \n'
  454.      Response expected: no.  Additional data: no.  Tell the server to
  455.      check whether FILENAME should be ignored, and if not, next time the
  456.      server sends responses, send (in a `M' response) `?' followed by
  457.      the directory and filename.
  458.  
  459. `Case \n'
  460.      Tell the server that filenames should be matched against ignore
  461.      patterns in a case-insensitive fashion.  Note that this does not
  462.      apply to other comparisons--for example the filenames given in
  463.      `Entry' and `Modified' requests for the same file must match in
  464.      case regardless of whether the `Case' request is sent.
  465.  
  466. `Argument TEXT \n'
  467.      Response expected: no.  Save argument for use in a subsequent
  468.      command.  Arguments accumulate until an argument-using command is
  469.      given, at which point they are forgotten.
  470.  
  471. `Argumentx TEXT \n'
  472.      Response expected: no.  Append \n followed by text to the current
  473.      argument being saved.
  474.  
  475. `Global_option OPTION \n'
  476.      Transmit one of the global options `-q', `-Q', `-l', `-t', `-r',
  477.      or `-n'.  OPTION must be one of those strings, no variations (such
  478.      as combining of options) are allowed.  For graceful handling of
  479.      `valid-requests', it is probably better to make new global options
  480.      separate requests, rather than trying to add them to this request.
  481.  
  482. `Set VARIABLE=VALUE \n'
  483.      Set a user variable VARIABLE to VALUE.
  484.  
  485. `expand-modules \n'
  486.      Response expected: yes.  Expand the modules which are specified in
  487.      the arguments.  Returns the data in `Module-expansion' responses.
  488.      Note that the server can assume that this is checkout or export,
  489.      not rtag or rdiff; the latter do not access the working directory
  490.      and thus have no need to expand modules on the client side.
  491.  
  492. `co \n'
  493. `ci \n'
  494. `diff \n'
  495. `tag \n'
  496. `status \n'
  497. `log \n'
  498. `add \n'
  499. `remove \n'
  500. `rdiff \n'
  501. `rtag \n'
  502. `admin \n'
  503. `export \n'
  504. `history \n'
  505. `watchers \n'
  506. `editors \n'
  507. `annotate \n'
  508.      Response expected: yes.  Actually do a cvs command.  This uses any
  509.      previous `Argument', `Repository', `Entry', `Modified', or `Lost'
  510.      requests, if they have been sent.  The last `Repository' sent
  511.      specifies the working directory at the time of the operation.  No
  512.      provision is made for any input from the user.  This means that
  513.      `ci' must use a `-m' argument if it wants to specify a log message.
  514.  
  515. `init ROOT-NAME \n'
  516.      Response expected: yes.  If it doesn't already exist, create a CVS
  517.      repository ROOT-NAME.  The `Root' request need not have been
  518.      previously sent.
  519.  
  520. `update \n'
  521.      Response expected: yes.  Actually do a `cvs update' command.  This
  522.      uses any previous `Argument', `Repository', `Entry', `Modified',
  523.      or `Lost' requests, if they have been sent.  The last `Repository'
  524.      sent specifies the working directory at the time of the operation.
  525.      The `-I' option is not used-files which the client can decide
  526.      whether to ignore are not mentioned and the client sends the
  527.      `Questionable' request for others.
  528.  
  529. `import \n'
  530.      Response expected: yes.  Actually do a `cvs import' command.  This
  531.      uses any previous `Argument', `Repository', `Entry', `Modified',
  532.      or `Lost' requests, if they have been sent.  The last `Repository'
  533.      sent specifies the working directory at the time of the operation.
  534.      The files to be imported are sent in `Modified' requests (files
  535.      which the client knows should be ignored are not sent; the server
  536.      must still process the CVSROOT/cvsignore file unless -I ! is
  537.      sent).  A log message must have been specified with a `-m'
  538.      argument.
  539.  
  540. `watch-on \n'
  541. `watch-off \n'
  542. `watch-add \n'
  543. `watch-remove \n'
  544.      Response expected: yes.  Actually do the `cvs watch on', `cvs
  545.      watch off', `cvs watch add', and `cvs watch remove' commands,
  546.      respectively.  This uses any previous `Argument', `Repository',
  547.      `Entry', `Modified', or `Lost' requests, if they have been sent.
  548.      The last `Repository' sent specifies the working directory at the
  549.      time of the operation.
  550.  
  551. `release \n'
  552.      Response expected: yes.  Note that a `cvs release' command has
  553.      taken place and update the history file accordingly.
  554.  
  555. `noop \n'
  556.      Response expected: yes.  This request is a null command in the
  557.      sense that it doesn't do anything, but merely (as with any other
  558.      requests expecting a response) sends back any responses pertaining
  559.      to pending errors, pending `Notified' responses, etc.
  560.  
  561. `update-patches \n'
  562.      This request does not actually do anything.  It is used as a
  563.      signal that the server is able to generate patches when given an
  564.      `update' request.  The client must issue the `-u' argument to
  565.      `update' in order to receive patches.
  566.  
  567. `gzip-file-contents LEVEL \n'
  568.      This request asks the server to filter files it sends to the client
  569.      through the `gzip' program, using the specified level of
  570.      compression.  If this request is not made, the server must not do
  571.      any compression.
  572.  
  573.      This is only a hint to the server.  It may still decide (for
  574.      example, in the case of very small files, or files that already
  575.      appear to be compressed) not to do the compression.  Compression
  576.      is indicated by a `z' preceding the file length.
  577.  
  578.      Availability of this request in the server indicates to the client
  579.      that it may compress files sent to the server, regardless of
  580.      whether the client actually uses this request.
  581.  
  582. `OTHER-REQUEST TEXT \n'
  583.      Response expected: yes.  Any unrecognized request expects a
  584.      response, and does not contain any additional data.  The response
  585.      will normally be something like `error  unrecognized request', but
  586.      it could be a different error if a previous command which doesn't
  587.      expect a response produced an error.
  588.  
  589.    When the client is done, it drops the connection.
  590.  
  591. 
  592. File: cvsclient.info,  Node: Responses,  Next: Example,  Prev: Requests,  Up: Protocol
  593.  
  594. Responses
  595. =========
  596.  
  597.    After a command which expects a response, the server sends however
  598. many of the following responses are appropriate.  Pathnames are of the
  599. actual files operated on (i.e. they do not contain `,v' endings), and
  600. are suitable for use in a subsequent `Repository' request.  However, if
  601. the client has used the `Directory' request, then it is instead a local
  602. directory name relative to the directory in which the command was given
  603. (i.e. the last `Directory' before the command).  Then a newline and a
  604. repository name (the pathname which is sent if `Directory' is not
  605. used).  Then the slash and the filename.  For example, for a file
  606. `i386.mh' which is in the local directory `gas.clean/config' and for
  607. which the repository is `/rel/cvsfiles/devo/gas/config':
  608.  
  609.      gas.clean/config/
  610.      /rel/cvsfiles/devo/gas/config/i386.mh
  611.  
  612.    Any response always ends with `error' or `ok'.  This indicates that
  613. the response is over.
  614.  
  615. `Valid-requests REQUEST-LIST \n'
  616.      Indicate what requests the server will accept.  REQUEST-LIST is a
  617.      space separated list of tokens.  If the server supports sending
  618.      patches, it will include `update-patches' in this list.  The
  619.      `update-patches' request does not actually do anything.
  620.  
  621. `Checked-in PATHNAME \n'
  622.      Additional data: New Entries line, \n.  This means a file PATHNAME
  623.      has been successfully operated on (checked in, added, etc.).  name
  624.      in the Entries line is the same as the last component of PATHNAME.
  625.  
  626. `New-entry PATHNAME \n'
  627.      Additional data: New Entries line, \n.  Like `Checked-in', but the
  628.      file is not up to date.
  629.  
  630. `Updated PATHNAME \n'
  631.      Additional data: New Entries line, \n, mode, \n, file
  632.      transmission.  A new copy of the file is enclosed.  This is used
  633.      for a new revision of an existing file, or for a new file, or for
  634.      any other case in which the local (client-side) copy of the file
  635.      needs to be updated, and after being updated it will be up to
  636.      date.  If any directory in pathname does not exist, create it.
  637.  
  638. `Merged PATHNAME \n'
  639.      This is just like `Updated' and takes the same additional data,
  640.      with the one difference that after the new copy of the file is
  641.      enclosed, it will still not be up to date.  Used for the results
  642.      of a merge, with or without conflicts.
  643.  
  644. `Patched PATHNAME \n'
  645.      This is just like `Updated' and takes the same additional data,
  646.      with the one difference that instead of sending a new copy of the
  647.      file, the server sends a patch produced by `diff -u'.  This client
  648.      must apply this patch, using the `patch' program, to the existing
  649.      file.  This will only be used when the client has an exact copy of
  650.      an earlier revision of a file.  This response is only used if the
  651.      `update' command is given the `-u' argument.
  652.  
  653. `Mode MODE \n'
  654.      This MODE applies to the next file mentioned in `Checked-in'.  It
  655.      does not apply to any request which follows a `Checked-in',
  656.      `New-entry', `Updated', `Merged', or `Patched' response.
  657.  
  658. `Checksum CHECKSUM\n'
  659.      The CHECKSUM applies to the next file sent over via `Updated',
  660.      `Merged', or `Patched'.  In the case of `Patched', the checksum
  661.      applies to the file after being patched, not to the patch itself.
  662.      The client should compute the checksum itself, after receiving the
  663.      file or patch, and signal an error if the checksums do not match.
  664.      The checksum is the 128 bit MD5 checksum represented as 32 hex
  665.      digits.  This response is optional, and is only used if the client
  666.      supports it (as judged by the `Valid-responses' request).
  667.  
  668. `Copy-file PATHNAME \n'
  669.      Additional data: NEWNAME \n.  Copy file PATHNAME to NEWNAME in the
  670.      same directory where it already is.  This does not affect
  671.      `CVS/Entries'.
  672.  
  673. `Removed PATHNAME \n'
  674.      The file has been removed from the repository (this is the case
  675.      where cvs prints `file foobar.c is no longer pertinent').
  676.  
  677. `Remove-entry PATHNAME \n'
  678.      The file needs its entry removed from `CVS/Entries', but the file
  679.      itself is already gone (this happens in response to a `ci' request
  680.      which involves committing the removal of a file).
  681.  
  682. `Set-static-directory PATHNAME \n'
  683.      This instructs the client to set the `Entries.Static' flag, which
  684.      it should then send back to the server in a `Static-directory'
  685.      request whenever the directory is operated on.  PATHNAME ends in a
  686.      slash; its purpose is to specify a directory, not a file within a
  687.      directory.
  688.  
  689. `Clear-static-directory PATHNAME \n'
  690.      Like `Set-static-directory', but clear, not set, the flag.
  691.  
  692. `Set-sticky PATHNAME \n'
  693.      Additional data: TAGSPEC \n.  Tell the client to set a sticky tag
  694.      or date, which should be supplied with the `Sticky' request for
  695.      future operations.  PATHNAME ends in a slash; its purpose is to
  696.      specify a directory, not a file within a directory.  The first
  697.      character of TAGSPEC is `T' for a tag, or `D' for a date.  The
  698.      remainder of TAGSPEC contains the actual tag or date.
  699.  
  700. `Clear-sticky PATHNAME \n'
  701.      Clear any sticky tag or date set by `Set-sticky'.
  702.  
  703. `Template PATHNAME \n'
  704.      Additional data: file transmission (note: compressed file
  705.      transmissions are not supported).  PATHNAME ends in a slash; its
  706.      purpose is to specify a directory, not a file within a directory.
  707.      Tell the client to store the file transmission as the template log
  708.      message, and then use that template in the future when prompting
  709.      the user for a log message.
  710.  
  711. `Set-checkin-prog DIR \n'
  712.      Additional data: PROG \n.  Tell the client to set a checkin
  713.      program, which should be supplied with the `Checkin-prog' request
  714.      for future operations.
  715.  
  716. `Set-update-prog DIR \n'
  717.      Additional data: PROG \n.  Tell the client to set an update
  718.      program, which should be supplied with the `Update-prog' request
  719.      for future operations.
  720.  
  721. `Notified PATHNAME \n'
  722.      Indicate to the client that the notification for PATHNAME has been
  723.      done.  There should be one such response for every `Notify'
  724.      request; if there are several `Notify' requests for a single file,
  725.      the requests should be processed in order; the first `Notified'
  726.      response pertains to the first `Notify' request, etc.
  727.  
  728. `Module-expansion PATHNAME \n Return a file or directory'
  729.      which is included in a particular module.  PATHNAME is relative to
  730.      cvsroot, unlike most pathnames in responses.  PATHNAME should be
  731.      used to look and see whether some or all of the module exists on
  732.      the client side; it is not necessarily suitable for passing as an
  733.      argument to a `co' request (for example, if the modules file
  734.      contains the `-d' option, it will be the directory specified with
  735.      `-d', not the name of the module).
  736.  
  737. `M TEXT \n'
  738.      A one-line message for the user.
  739.  
  740. `E TEXT \n'
  741.      Same as `M' but send to stderr not stdout.
  742.  
  743. `error ERRNO-CODE ` ' TEXT \n'
  744.      The command completed with an error.  ERRNO-CODE is a symbolic
  745.      error code (e.g. `ENOENT'); if the server doesn't support this
  746.      feature, or if it's not appropriate for this particular message,
  747.      it just omits the errno-code (in that case there are two spaces
  748.      after `error').  Text is an error message such as that provided by
  749.      strerror(), or any other message the server wants to use.
  750.  
  751. `ok \n'
  752.      The command completed successfully.
  753.  
  754. 
  755. File: cvsclient.info,  Node: Example,  Next: Requirements,  Prev: Responses,  Up: Protocol
  756.  
  757. Example
  758. =======
  759.  
  760.    Lines beginning with `c>' are sent by the client; lines beginning
  761. with `s>' are sent by the server; lines beginning with `#' are not part
  762. of the actual exchange.
  763.  
  764.      c> Root /rel/cvsfiles
  765.      # In actual practice the lists of valid responses and requests would
  766.      # be longer
  767.      c> Valid-responses Updated Checked-in M ok error
  768.      c> valid-requests
  769.      s> Valid-requests Root co Modified Entry Repository ci Argument Argumentx
  770.      s> ok
  771.      # cvs co devo/foo
  772.      c> Argument devo/foo
  773.      c> co
  774.      s> Updated /rel/cvsfiles/devo/foo/foo.c
  775.      s> /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  776.      s> 26
  777.      s> int mein () { abort (); }
  778.      s> Updated /rel/cvsfiles/devo/foo/Makefile
  779.      s> /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  780.      s> 28
  781.      s> foo: foo.c
  782.      s>         $(CC) -o foo $<
  783.      s> ok
  784.      # In actual practice the next part would be a separate connection.
  785.      # Here it is shown as part of the same one.
  786.      c> Repository /rel/cvsfiles/devo/foo
  787.      # foo.c relative to devo/foo just set as Repository.
  788.      c> Entry /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  789.      c> Entry /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  790.      c> Modified foo.c
  791.      c> 26
  792.      c> int main () { abort (); }
  793.      # cvs ci -m <log message> foo.c
  794.      c> Argument -m
  795.      c> Argument Well, you see, it took me hours and hours to find this typo and I
  796.      c> Argumentx searched and searched and eventually had to ask John for help.
  797.      c> Argument foo.c
  798.      c> ci
  799.      s> Checked-in /rel/cvsfiles/devo/foo/foo.c
  800.      s> /foo.c/1.5/ Mon Apr 19 15:54:22 CDT 1993//
  801.      s> M Checking in foo.c;
  802.      s> M /cygint/rel/cvsfiles/devo/foo/foo.c,v  <--  foo.c
  803.      s> M new revision: 1.5; previous revision: 1.4
  804.      s> M done
  805.      s> ok
  806.  
  807. 
  808. File: cvsclient.info,  Node: Requirements,  Prev: Example,  Up: Protocol
  809.  
  810. Required versus optional parts of the protocol
  811. ==============================================
  812.  
  813.    The following are part of every known implementation of the CVS
  814. protocol and it is considered reasonable behavior to completely fail to
  815. work if you are connected with an implementation which attempts to not
  816. support them.  Requests: Root, Valid-responses, valid-requests,
  817. Repository, Entry, Modified, Argument, Argumentx, ci, co, update.
  818. Responses: ok, error, Valid-requests, Checked-in, Updated, Merged,
  819. Removed, M, E.
  820.  
  821.    Failure to support the Directory, UseUnchanged, and Unchanged
  822. requests is deprecated.  CVS 1.5 and later have supported these
  823. requests and in the future it will be considered reasonable behavior to
  824. completely fail to work with an implementation which attempts to not
  825. support them.  Support for the Repository and Lost requests is
  826. deprecated; CVS clients 1.5 and later will not use them if
  827. communicating with a server which supports Directory and UseUnchanged.
  828.  
  829.  
  830. 
  831. Tag Table:
  832. Node: Top99
  833. Node: Introduction924
  834. Node: Goals3458
  835. Node: Notes4964
  836. Node: Protocol Notes6208
  837. Node: Connection and Authentication7911
  838. Node: Protocol10514
  839. Node: Entries Lines10913
  840. Node: Modes11621
  841. Node: Filenames13144
  842. Node: Requests13895
  843. Node: Responses26668
  844. Node: Example34133
  845. Node: Requirements36079
  846. 
  847. End Tag Table
  848.